package org.jsola.hr.web;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.jsola.core.Page;
import org.jsola.core.Result;
import org.jsola.hr.dto.PersonalEventAddDTO;
import org.jsola.hr.dto.PersonalEventUpdateDTO;
import org.jsola.hr.query.PersonalEventQuery;
import org.jsola.hr.vo.PersonalEventListVO;
import org.jsola.hr.vo.PersonalEventResultByYearVO;
import org.jsola.hr.vo.PersonalEventVO;
import org.springframework.web.bind.annotation.GetMapping;

import javax.validation.Valid;
import java.util.List;

/**
 * 人事变动表
 *
 * @author ds
 */
@Api(tags = "hr-人事变动表")
public interface IPersonalEventControllerAPI {

    /**
     * 新增人事变动表
     *
     * @param personalEventAddDTO 人事变动表新增实体
     * @return 人事变动表展示对象
     */
    @ApiOperation(value = "新增人事变动表")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "personalEventAddDTO", dataType = "PersonalEventAddDTO", value = "新增人事变动表", paramType = "body")
    })
    Result<PersonalEventVO> save(PersonalEventAddDTO personalEventAddDTO);


    /**
     * 修改人事变动表
     *
     * @param personalEventUpdateDTO 人事变动表
     * @return 更新数量
     */
    @ApiOperation(value = "修改人事变动表")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "personalEventUpdateDTO", dataType = "PersonalEventUpdateDTO", value = "修改人事变动表", paramType = "body")
    })
    Result<Integer> update(PersonalEventUpdateDTO personalEventUpdateDTO);


    /**
     * 删除单个人事变动表，彻底删除
     *
     * @param personalEventId 人事变动表id
     * @return 删除数量
     */
    @ApiOperation(value = "删除单个人事变动表，彻底删除")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "personalEventId", dataType = "Long", value = "人事变动表id", paramType = "path")
    })
    Result<Integer> delete(Long personalEventId);


    /**
     * 批量删除人事变动表，彻底删除
     *
     * @param personalEventIds 人事变动表id集合
     * @return 删除数量
     */
    @ApiOperation(value = "批量删除人事变动表，彻底删除")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "personalEventIds", dataType = "Long[]", value = "人事变动表id数组", paramType = "body", allowMultiple = true)
    })
    Result<Integer> deleteBatch(Long[] personalEventIds);


    /**
     * 根据人事变动表id查询人事变动表详情
     *
     * @param personalEventId 人事变动表id
     * @return 人事变动表详情
     */
    @ApiOperation(value = "根据人事变动表id查询人事变动表详情")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "personalEventId", dataType = "Long", value = "人事变动表id", paramType = "path")
    })
    Result<PersonalEventVO> findById(Long personalEventId);


    /**
     * 查询人事变动表
     *
     * @param personalEventQuery 人事变动表查询参数
     * @return page
     */
    @ApiOperation(value = "查询人事变动表")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "personalEventQuery", dataType = "PersonalEventQuery", value = "人事变动表查询参数", paramType = "query")
    })
    Result<List<PersonalEventListVO>> listAll(PersonalEventQuery personalEventQuery);


    @GetMapping(value = "/listAll")
    Result<List<PersonalEventResultByYearVO>> selectByEmpId(@Valid String empId);


//    /**
//     * 查询用户的人事变动
//     *
//     * @param userId 用户Id
//     * @return 员工的人事变动
//     */
//    @ApiOperation(value = "查询人事变动表")
//    @ApiImplicitParams({
//            @ApiImplicitParam(name = "userId", dataType = "String", value = "用户Id", paramType = "query")
//    })
//    Result<List<PersonalEventResultByYearVO>> selectByUserId(String userId);

    /**
     * 分页查询人事变动表
     *
     * @param personalEventQuery 人事变动表查询参数
     * @return page
     */
    @ApiOperation(value = "分页查询人事变动表")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "personalEventQuery", dataType = "PersonalEventQuery", value = "人事变动表查询参数", paramType = "query")
    })
    Result<Page<PersonalEventListVO>> page(PersonalEventQuery personalEventQuery);


}

